package engine.collider;

import engine.gameObject.GameObject;

public class ContactPoint {

	//Point of collision
	private double px;
	private double py;
	private double pz;
	
	//Vector, that is pointing away from the collision
	private double vx;
	private double vy;
	private double vz;
	
	//Distance, that the object already traveled, to decide, what collision occured first. 
	private double distance;
	
	private GameObject gameObject;
	private GameObject collider;
	
	public ContactPoint(double px, double py, double pz, double vx, double vy, double vz, double distance) {
		this.px = px;
		this.py = py;
		this.pz = pz;
		
		this.vx = vx;
		this.vy = vy;
		this.vz = vz;
		
		this.distance = distance;
	}
	
	public double getPx() {
		return px;
	}
	
	public double getPy() {
		return py;
	}
	
	public double getPz() {
		return pz;
	}
	
	public void setVx(double vx) {
		this.vx = vx;
	}
	
	public double getVx() {
		return vx;
	}
	
	public void setVy(double vy) {
		this.vy = vy;
	}
	
	public double getVy() {
		return vy;
	}
	
	public void setVz(double vz) {
		this.vz = vz;
	}
	
	public double getVz() {
		return vz;
	}
	
	public double[] getV() {
		return new double[]{vx, vy, vz};
	}
	
	public GameObject getGameObject() {
		return gameObject;
	}
	
	public void setGameObject(GameObject gameObject) {
		this.gameObject = gameObject;
	}
	
	public GameObject getCollider() {
		return collider;
	}
	
	public void setCollider(GameObject collider) {
		this.collider = collider;
	}

	public double getDistance() {
		return distance;
	}

	public void setDistance(double distance) {
		this.distance = distance;
	}
	
	public ContactPoint clone() {
		return new ContactPoint(px, py, pz, vx, vy, vz, distance);
	}
}
